/*
 * 菜单
 *
 * @Author:    1024创新实验室-主任：卓大
 * @Date:      2022-09-03 22:00:32
 * @Wechat:    zhuda1024
 * @Email:     lab1024@163.com
 * @Copyright  1024创新实验室 （ https://1024lab.net ），Since 2012
 */
import {getRequest, postRequest,download} from '/@/lib/axios';

export const businessesApi = {
    /**
     * 添加菜单
     */
    addMenu: (param) => {
        return postRequest('/menu/add', param);
    },

    /**
     * 更新菜单
     */
    updateMenu: (param) => {
        return postRequest('/menu/update', param);
    },

    /**
     * 批量删除菜单
     */
    batchDeleteMenu: (menuIdList) => {
        return getRequest(`/menu/batchDelete?menuIdList=${menuIdList}`);
    },


    /**
     * @description: 删除医馆信息
     * @param {number} businessesid
     * @return {*}
     */
    deleteBusinessesByid: (id) => {
        return getRequest(`/infirmary/businesses/delete/${id}`);
    },

    deleteBusinessesStationByid: (param, id) => {
        return getRequest(`/infirmary/businesses/station/delete/${id}`, param);
    },

    /**
     * 查询所有菜单列表
     */
    queryBusinessesList: (param) => {
        return getRequest('/infirmary/businesses/query/list', param);
    },

    queryBusinessesDoctorList: (param) => {
        return getRequest('/infirmary/businesses/doctor/query/list', param);
    },

    queryBusinessesDoctorStationRule: (param) => {
        return getRequest('/infirmary/businesses/doctor/station/rule/info', param);
    },

    updateBusinessesDoctorStationRule: (param) => {
        return postRequest('/infirmary/businesses/doctor/station/rule/info/update', param);
    },


    addNewBusinessesDoctorStationRule: (param) => {
        return postRequest('/infirmary/businesses/doctor/station/rule/info/addnewuser', param);
    },

    /**
     * 新增医生的临时排班接口处理
     */
    addNewBusinessesDoctorInterimScheduling: (param) => {
        return postRequest('/infirmary/businesses/doctor/interim/scheduling/info/add', param);
    },


    /**
     * 查询所有医馆列表列表
     */
    queryBusinessesQueryValueList: (param) => {
        return getRequest('/infirmary/businesses/query/list/valueList', param);
    },

    /**
     *  根据ID删除医生的排班某一条的记录信息
     */
    deleteBusinessesDoctorSchedulingDeasListQuery: (id,param) => {
        return getRequest(`/infirmary/businesses/doctor/user/scheduling/delete/${id}`, param);
    },

    deleteBatchBusinessesDoctorSchedulingDeasListQuery: (appid,dc_number,keyIdList) => {
        return postRequest('/infirmary/businesses/doctor/user/scheduling/delete/batch', {
            'appid':appid,
            'ids':keyIdList,
            'dc_number':dc_number,
        });
    },

    /**
     * 查询所有医馆列表列表
     */
    queryDoctorStationNameListValueList: (param) => {
        return getRequest('/infirmary/businesses/query/doctor/user/scheduling/list/valueList', param);
    },


    /**
     * 更新医馆信息
     */
    updateBusinessesinfo: (param) => {
        return postRequest('/infirmary/businesses/update', param);
    },

    /**
     * 更新医馆医生的描述信息
     */
    updateBusinessesDoctorUserinfo: (param) => {
        return postRequest('/infirmary/businesses/doctor/user/update', param);
    },


    /**
     * 添加医馆医生的描述信息
     */
    addBusinessesDoctorUserinfo: (param) => {
        return postRequest('/infirmary/businesses/doctor/user/add', param);
    },

    deleteBusinessesDoctorUserByid: (param,id) => {
        return getRequest(`/infirmary/businesses/doctor/user/delete/${id}`, param);
    },


    /**
     * 添加医馆信息
     */
    addBusinessesinfo: (param) => {
        return postRequest('/infirmary/businesses/add', param);
    },

    /**
     * 更新医馆信息
     */
    updateBusinessesStationinfo: (param) => {
        return postRequest('/infirmary/businesses/station/update', param);
    },

    /**
     * 添加医馆信息
     */
    addBusinessesStationinfo: (param) => {
        return postRequest('/infirmary/businesses/station/add', param);
    },


    /**
     * 分页查询驻点医馆列表 - @author 小钟同学
     */
    postBusinessesStationListQuery: (param) => {
        return getRequest('/infirmary/businesses/station/query/list', param);
    },

    /**
     * 分页查询驻点医馆列表 - @author 小钟同学
     */
    getBusinessesDoctorSchedulingDeasListQuery: (param) => {
        return getRequest('/infirmary/businesses/doctor/scheduling/query/list', param);
    },
    /**
     * 分页查询医生预约的订单详情列表信息- @author 小钟同学
     */
    getBusinessesDoctorSchedulingDeasOrderListQuery: (param) => {
        return getRequest('/infirmary/businesses/doctor/scheduling/order/query/list', param);
    },


    /**
     * 导出医生就诊订单信息
     */
    downloadBusinessesDoctorSchedulingDeasOrderDownloadListQuery: (filename,param) => {
        return download(filename,'/infirmary/businesses/doctor/scheduling/order/query/download/list', param);
    },


    /**
     * 查询菜单树
     */
    queryMenuTree: (onlyMenu) => {
        return getRequest(`/menu/tree?onlyMenu=${onlyMenu}`);
    },

    /**
     * 获取所有请求路径
     */
    getAuthUrl: () => {
        return getRequest('/menu/auth/url');
    },
};
